package com.example.demo.entity;


import java.util.List;
import lombok.Data;

/**
 * @author kaixuan.xu
 * @version 1.0.0
 * @date 2018/12/19 17:28
 * @description
 */
@Data
public class Fruit {

  private Long id;

  private String name;

  private List<Enum> colorList;

  public Fruit() {
  }

  public Fruit(Builder builder) {
    this.id = builder.id;
    this.name = builder.name;
    this.colorList = builder.colorList;
  }

  public Long getId() {
    return id;
  }

  public void setId(Long id) {
    this.id = id;
  }

  public String getName() {
    return name;
  }

  public void setName(String name) {
    this.name = name;
  }

  public List<Enum> getColorList() {
    return colorList;
  }

  public void setColorList(List<Enum> colorList) {
    this.colorList = colorList;
  }

  public static class Builder {

    private Long id;

    private String name;

    private List<Enum> colorList;

    public Builder id(Long id) {
      this.id = id;
      return this;
    }

    public Builder name(String name) {
      this.name = name;
      return this;
    }

    public Builder colorList(List colorList) {
      this.colorList = colorList;
      return this;
    }

    public Fruit build() {
      return new Fruit(this);
    }
  }
}
